#!/usr/bin python
# -*- coding: utf-8 -*-
from ConfigParser import SafeConfigParser, NoOptionError, ParsingError

# =====================================================================================
# ============= nacteni udaju z ini souboru ===========================================
# =====================================================================================
nazevIniSouboru = '/automat/konfigurace.ini' # automat crocodille
#nazevIniSouboru = '/home/petr/crocomat/konfigurace.ini' # PJ dilenske PC
#nazevIniSouboru = '/home/petr/automat/crocodille/konfigurace.ini' # PJ domaci PC
confDict = SafeConfigParser()
confDict.read(nazevIniSouboru)


adresarRAMDisk=confDict.get('DEFAULT', 'adresarRAMDisk')    
adresarDatabazeAutomatu=confDict.get('DEFAULT', 'adresarDatabazeAutomatu')
db_filename=confDict.get('DEFAULT', 'db_filename')
tmp_db_filename=confDict.get('DEFAULT', 'tmp_db_filename')


#souborStavovehoDiagramu=confDict.get('DEFAULT', 'souborStavovehoDiagramu')

adresarDataTelemetrie=confDict.get('FTP', 'adresarDataTelemetrie')
adresarPrenosDatProCentraluFTP = confDict.get('FTP', 'dataProCentralu')
adresarDataProAutomat = confDict.get('FTP', 'dataProAutomat')
adresarProUpdateSoubory = confDict.get('FTP', 'adresarProUpdateSoubory')
nazevFTPserveruCentrala = confDict.get('FTP', 'ftpHostCentrala')
ftpUserCentrala = confDict.get('FTP', 'ftpUserCentrala')
ftpPasswCentrala = confDict.get('FTP', 'ftpPasswCentrala')
absCestaRootNaServeruFTPCentrala = confDict.get('FTP', 'absCestaRootNaServeruFTPCentrala')
nazevFTPserveruTelem = confDict.get('FTP', 'ftpHostTelem')
ftpUserTelem = confDict.get('FTP', 'ftpUserTelem')
ftpPasswTelem = confDict.get('FTP', 'ftpPasswTelem')
absCestaRootNaServeruFTPTelem = confDict.get('FTP', 'absCestaRootNaServeruFTPTelem')
periodaOpakovaniPrenosu = int(confDict.get('FTP','periodaOpakovaniPrenosu'))
pocetOpakovaniDoResetuModemu = int(confDict.get('FTP','pocetOpakovaniDoResetuModemu'))

cisloProZaslaniChybovychSMS = confDict.get('ETC', 'cisloProZaslaniChybovychSMS')
smsNumbersWhiteList = confDict.get('ETC', 'smsNumbersWhiteList')
smsNumbersIgnoredList = confDict.get('ETC', 'smsNumbersIgnoredList')
povoleneIButtony = confDict.get('ETC', 'povoleneIButtony')


adresaProOvereniPPP = confDict.get('ETC', 'adresaProOvereniPPP')
adresaProOvereniVPN = confDict.get('ETC', 'adresaProOvereniVPN')
cisloAutomatu = confDict.get('ETC', 'cisloAutomatu')
#cisloTestovacihoAutomatu = confDict.get('ETC', 'cisloTestovacihoAutomatu')
#cisloSackuNaPenize = confDict.get('ETC', 'cisloSackuNaPenize')
#fwMincovnik = confDict.get('ETC', 'fwMincovnik')

semaforPrenesDataCentrala = confDict.get('ETC', 'semaforPrenesDataCentrala')
semaforPrenesDataTelem = confDict.get('ETC', 'semaforPrenesDataTelem')
#semaforResetI2C = confDict.get('ETC', 'semaforResetI2C')
semaforPrihlasenTechnik = confDict.get('ETC', 'semaforPrihlasenTechnik')
semaforAutomatNabiha = confDict.get('ETC', 'semaforAutomatNabiha')
#semaforMuzesZabit = confDict.get('ETC', 'semaforMuzesZabit')
#semaforPozadavekNaZastaveni = confDict.get('ETC', 'semaforPozadavekNaZastaveni')
#semaforNapeti230JeOdpojeno = confDict.get('ETC', 'semaforNapeti230JeOdpojeno')
#semaforAutomatRucneOdstaven = confDict.get('ETC', 'semaforAutomatRucneOdstaven')
#semaforMincovnikManualFill = confDict.get('ETC', 'semaforMincovnikManualFill')
#semaforMincovnikFwUpdate = confDict.get('ETC', 'semaforMincovnikFwUpdate')



#razitkoAutomatZije = confDict.get('ETC', 'razitkoAutomatZije')
#razitkoMincovnikZije = confDict.get('ETC', 'razitkoMincovnikZije')
razitkoGSMZije = confDict.get('ETC', 'razitkoGSMZije')
#razitkoAktivitaZakaznika = confDict.get('ETC', 'razitkoAktivitaZakaznika')
razitkoPrenosZahajenCentrala = confDict.get('ETC','razitkoPrenosZahajenCentrala')
razitkoPrenosZahajenTelem = confDict.get('ETC','razitkoPrenosZahajenTelem')
razitkoHsoRestart = confDict.get('ETC','razitkoHsoRestart')
razitkoCrocoMainZije = confDict.get('ETC','razitkoCrocoMainZije')
razitkoNacitaniDatZije = confDict.get('ETC','razitkoNacitaniDatZije')

pocetOpakovaniPrenosuCentrala = confDict.get('ETC','pocetOpakovaniPrenosuCentrala')
pocetOpakovaniPrenosuTelem = confDict.get('ETC','pocetOpakovaniPrenosuTelem')
pozadavekNaRestartGSM = confDict.get('ETC', 'pozadavekNaRestartGSM')
pozadavekChciProvest = confDict.get('ETC', 'pozadavekChciProvest')
silaSignaluGSM = confDict.get('ETC', 'silaSignaluGSM')
#verzeFirmwarePIC = confDict.get('ETC', 'verzeFirmwarePIC')
semaforNactiDexData = confDict.get('ETC', 'semaforNactiDexData')
semaforNapeti230V_OK = confDict.get('ETC', 'semaforNapeti230V_OK')
semaforDvereAutomatuOtevreny = confDict.get('ETC', 'semaforDvereAutomatuOtevreny')
semaforSacekNaMinceJePrilozen = confDict.get('ETC', 'sacekNaMinceJePrilozen')
semaforSacekNaMinceJeVyjmut = confDict.get('ETC', 'sacekNaMinceJeVyjmut')


adresarLog = confDict.get('LOG', 'adresarLog')
souborLogAutomat = confDict.get('LOG', 'souborLogAutomatPlnaCesta')
souborLogGprs = confDict.get('LOG', 'souborLogGprsPlnaCesta')
souborLogGsm = confDict.get('LOG', 'souborLogGsmPlnaCesta')
souborLogNacitaniDat = confDict.get('LOG', 'souborLogNacitaniDatPlnaCesta')


nacitaniDatLogLevel = int(confDict.get('LOG', 'nacitaniDatLogLevel'))
automatLogLevel = int(confDict.get('LOG', 'automatLogLevel'))
gprsLogLevel = int(confDict.get('LOG', 'gprsLogLevel'))
gsmLogLevel = int(confDict.get('LOG', 'gsmLogLevel'))
pocetRadkuPredCritical = int(confDict.get('LOG', 'pocetRadkuPredCritical'))
pocetRadkuPoCritical = int(confDict.get('LOG', 'pocetRadkuPoCritical'))

pidGsmRobot = confDict.get('PID', 'pidGsmRobot')
